package com.springboot.util.common;

import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;


/**
 * @description:
 * @author: zyj
 * @create: 2020-11-10 15:30
 **/
@Slf4j
public class MyJsonUtil {

    /** 解析消息
     * @param message
     * @return com.smjj.config.vo.DataCenterMessage
     * @author zyj
     */
    public static JSONObject getJsonObjectMessage(byte[] message) {

        try {
            String jsonString = new String(message, "UTF-8");
            return JSONObject.parseObject(jsonString);

        } catch (Exception e) {
            log.error("JSON解码异常,message:[{}]",message.toString(), e);
            return null;
        }

    }
}
